package org.ns.framework.datasource.mybatis;

import org.ns.framework.datasource.database.SegmentResult;

public class MybatisSegmentResult implements SegmentResult {
	private Throwable throwable;
	private Object result;

	public MybatisSegmentResult(Throwable throwable, Object result) {
		this.throwable = throwable;
		this.result = result;
	}

	public MybatisSegmentResult(Object result) {
		super();
		this.result = result;
	}

	@Override
	public boolean commitOK() {

		return getThrowable() != null;
	}

	@Override
	public Throwable getThrowable() {

		return throwable;
	}

	@Override
	public Object getResult() {

		return result;
	}

}
